package com.dcy.daily.skill.log4j2.customer;

import com.dcy.daily.common.config.annotation.ComponentUtil;
import org.apache.logging.log4j.LogManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;

/**
 * @author duanchunyu
 * @version 1.0.0
 * @Description Log2j2测试
 * @createTime 2021年05月20日 10:57:00
 */
@ComponentUtil.CComponent
public class Log4j2Usage implements ApplicationRunner {
    private static final Logger logger = LoggerFactory.getLogger(Log4j2Usage.class);
    private static final org.apache.logging.log4j.Logger logger1 = LogManager.getLogger(Log4j2Usage.class);

    /**
     * @description log4j2配置文件中不同日志级别的输出信息用例
     * @author duanchunyu
     * @updateTime 2021/5/24 16:03
     * @throws
     */
    @Override
    public void run(ApplicationArguments args) throws Exception {
        logger.trace("trace1");
        logger.debug("哈哈");
        logger.info("info1");
        logger.warn("warn1");
        logger.error("error1");
    }
}
